using System.Web;
using EPiServer.Core;

namespace OpenWaves.EPiServer
{
    public abstract class HttpHandler<T> : IHttpHandler where T : PageData
    {
        private T currentPage;

        protected T CurrentPage
        {
            get
            {
                if (this.currentPage == null)
                {
                    this.currentPage = (T)HttpContext.Current.GetCurrentPage();
                }
                return this.currentPage;
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }

        public abstract void ProcessRequest(HttpContext context);
    }
}